package com.pansoft.openplanet.bean;

import java.io.Serializable;

/**
 * 交易明细的bean
 */
public class TransactionBean  implements Serializable{

    private String transactionNumber;//交易编号
    private String fromAddress;//付款地址
    private String toAddress;//收款地址
    private String time;//交易时间
    private String amount;//交易数量

    private int transactionType;//交易类型
    private boolean transactionStatus;//交易状态

    private String gas;//矿工费用
    private String note;//备注
    private String block;//所属区块
    private int chainId;

    private TransactionBean(Builder builder) {
        transactionNumber = builder.transactionNumber;
        fromAddress = builder.fromAddress;
        toAddress = builder.toAddress;
        time = builder.time;
        amount = builder.amount;
        transactionType = builder.transactionType;
        transactionStatus = builder.transactionStatus;
        gas = builder.gas;
        note = builder.note;
        block = builder.block;
        chainId = builder.chainId;
    }


    public String getBlock() {
        return block;
    }

    public String getTransactionNumber() {
        return transactionNumber;
    }

    public String getFromAddress() {
        return fromAddress;
    }

    public String getToAddress() {
        return toAddress;
    }

    public String getTime() {
        return time;
    }

    public String getAmount() {
        return amount;
    }

    public int getTransactionType() {
        return transactionType;
    }

    public boolean getTransactionStatus() {
        return transactionStatus;
    }

    public String getGas() {
        return gas;
    }

    public String getNote() {
        return note;
    }

    public int getChainId() {
        return chainId;
    }

    public static final class Builder {
        private String transactionNumber;
        private String fromAddress;
        private String toAddress;
        private String time;
        private String amount;
        private int transactionType;
        private boolean transactionStatus;
        private String gas;
        private String note;
        private String block;
        private int chainId;

        public Builder() {
        }

        public Builder transactionNumber(String val) {
            transactionNumber = val;
            return this;
        }

        public Builder fromAddress(String val) {
            fromAddress = val;
            return this;
        }

        public Builder toAddress(String val) {
            toAddress = val;
            return this;
        }

        public Builder time(String val) {
            time = val;
            return this;
        }

        public Builder amount(String val) {
            amount = val;
            return this;
        }

        public Builder transactionType(int val) {
            transactionType = val;
            return this;
        }

        public Builder transactionStatus(boolean val) {
            transactionStatus = val;
            return this;
        }

        public Builder gas(String val) {
            gas = val;
            return this;
        }

        public Builder note(String val) {
            note = val;
            return this;
        }

        public Builder block(String val) {
            block = val;
            return this;
        }

        public Builder chainId(int val) {
            chainId = val;
            return this;
        }

        public TransactionBean build() {
            return new TransactionBean(this);
        }
    }

    @Override
    public String toString() {
        return "TransactionBean{" +
                "transactionNumber='" + transactionNumber + '\'' +
                ", fromAddress='" + fromAddress + '\'' +
                ", toAddress='" + toAddress + '\'' +
                ", amount='" + amount + '\'' +
                ", gas='" + gas + '\'' +
                '}';
    }
}
